<?php
define('LIBEMOTICONS','1.00');
/************************************************************************/
/* FrameWork  test preview                                              */
/* ==================================================================== */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// libshared/emoticonss.inc
//-------------------------------------------------------------------------------------------------------------------------

function emoticons2html($string){
	$string = str_replace(":)", "<img src='libs/libEmoticons/images/01.png' />", $string);
	$string = str_replace(":(", "<img src='libs/libEmoticons/images/02.png' />", $string);
	$string = str_replace(":o", "<img src='libs/libEmoticons/images/03.png' />", $string);
	$string = str_replace(":p", "<img src='libs/libEmoticons/images/04.png' />", $string);
	$string = str_replace(":D", "<img src='libs/libEmoticons/images/05.png' />", $string);
	$string = str_replace(":!", "<img src='libs/libEmoticons/images/06.png' />", $string);
	$string = str_replace(":O", "<img src='libs/libEmoticons/images/07.png' />", $string);
	$string = str_replace("8)", "<img src='libs/libEmoticons/images/08.png' />", $string);
	$string = str_replace(";)", "<img src='libs/libEmoticons/images/09.png' />", $string);

	$string = str_replace(":-)", "<img src='libs/libEmoticons/images/01.png' />", $string);
	$string = str_replace(":-(", "<img src='libs/libEmoticons/images/02.png' />", $string);
	$string = str_replace(":-o", "<img src='libs/libEmoticons/images/03.png' />", $string);
	$string = str_replace(":-p", "<img src='libs/libEmoticons/images/04.png' />", $string);
	$string = str_replace(":-D", "<img src='libs/libEmoticons/images/05.png' />", $string);
	$string = str_replace(":-!", "<img src='libs/libEmoticons/images/06.png' />", $string);
	$string = str_replace(":-O", "<img src='libs/libEmoticons/images/07.png' />", $string);
	$string = str_replace("8-)", "<img src='libs/libEmoticons/images/08.png' />", $string);
	$string = str_replace(";-)", "<img src='libs/libEmoticons/images/09.png' />", $string);

	return $string;
}
//-------------------------------------------------------------------------------------------------------------------------
function html2emoticons($string){

	$string = str_replace("<img src='libs/libEmoticons/images/09.png' />", ";-)", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/08.png' />", "8-)", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/06.png' />", ":-!", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/06.png' />", ":-!", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/05.png' />", ":-D", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/04.png' />", ":-p", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/03.png' />", ":-o", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/02.png' />", ":-(", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/01.png' />", ":-)", $string);

	$string = str_replace("<img src='libs/libEmoticons/images/09.png' />", ";)", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/08.png' />", "8)", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/07.png' />", ":O", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/06.png' />", ":!", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/05.png' />", ":D", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/04.png' />", ":p", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/03.png' />", ":o", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/02.png' />", ":(", $string);
	$string = str_replace("<img src='libs/libEmoticons/images/01.png' />", ":)", $string);

	return $string;

}
